Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid app crashes if /customization/html/details folder is missing #996

Merged

Conversation

dtrucs
Copy link
Collaborator

@dtrucs dtrucs commented Nov 7, 2023

Since 3.16.0, the app crashes on runtime if the /customization/html/details folder is missing

@dtrucs dtrucs requested a review from a team November 7, 2023 15:43
@@ -3,6 +3,9 @@ const deepmerge = require('deepmerge');
const { getLocales } = require('./getLocales');

function getFiles(dir, files = []) {
if (!fs.existsSync(dir)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fs.existsSync() is the synchronous version of fs.exists().
fs.exists() is now deprecated and recommand using fs.stats() of fs.access() instead.
fs.stats() doesn't seems to have a sync version, but fs.access() does : fs.accessSync().

So it might be better to use fs.accessSync().

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your advice 👍
I added a commit about it

@dtrucs dtrucs merged commit 64f6bb2 into main Nov 16, 2023
1 check passed
@dtrucs dtrucs deleted the Avoid-app-crashes-if-customization-html-details-folder-is-missing branch December 14, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants